package com.wang.hashtest;

import java.util.HashMap;
import java.util.Map;

//使用 For Each keySet 的方式进行遍历
public class HashMapTest4 {
    public static void main(String[] args) {
        Map<Integer,String > map = new HashMap<>();
        map.put(1,"java");
        map.put(2,"c++");
        map.put(3,"golang");
        map.put(4,"python");
        map.put(5,"php");

        for (Integer key: map.keySet() ) {
            System.out.println(key);
            System.out.println(map.keySet());
        }
    }
}
